#ifndef DVARIABLETABLEMODEL_H
#define DVARIABLETABLEMODEL_H

class DVariableEntity;

class DVariableTableModel : public QAbstractTableModel
{
	Q_OBJECT

public:
	DVariableTableModel(QList<DVariableEntity*>& variables, QObject *parent = 0);
	~DVariableTableModel();

	int rowCount(const QModelIndex &parent = QModelIndex()) const;
	int columnCount(const QModelIndex &parent = QModelIndex()) const;
    QVariant data(const QModelIndex &index, int role) const;
    QVariant headerData(int section, Qt::Orientation orientation,
                         int role = Qt::DisplayRole) const;

	Qt::ItemFlags flags(const QModelIndex &index) const;
    bool setData(const QModelIndex &index, const QVariant &value,
                  int role = Qt::EditRole);

	void addVariable(const QString& name, const QString& type, Access access);
private:
	QList<DVariableEntity*>& m_variables;
};

#endif // DVARIABLETABLEMODEL_H
